import { forwardRef, Ref } from 'react';
import api from './api';
import ProcessManage from '@inbiz/basic/ProcessManage';
type IRef = Ref<ReturnType<typeof api>>;

export interface IProps {
  processGroup: boolean;
  callBackEvents: {
    onExtendsSave?: (params: any) => Promise<any>;
    formatTableData?: (rows: any[]) => any;
  };
  inline: string[];
  exposureConfig: {
    ownership: boolean;
  };
  processGroupSelector: any[];
  pagesNum: number;
  processType: boolean;
  ScopeProcess: 'all' | 'app' | 'group';
  defaultOption: any[];
  processName: boolean;
  toolbar: string[];
  inbiz: any;
  emit?: {
    (type: 'onSave', handleType: 'add' | 'edit', data: object): void;
    (type: 'onSaveAndPublish', handleType: 'add' | 'edit', data: object): void;
    (type: 'onSelectGroup', groupId: string): void;
  };
}

const ProcessManagement = (props: IProps, ref: IRef) => {
  return (<ProcessManage {...props} refs={ref}/>)
};

export default forwardRef(ProcessManagement);
